//
//  NRWCarDetailBaseInfoCell.m
//  NRWMall
//
//  Created by 张记 on 2018/5/22.
//  Copyright © 2018年 com.anpxd. All rights reserved.
//

#import "NRWCarDetailBaseInfoCell.h"

@interface NRWCarDetailBaseInfoCell ()
@property (weak, nonatomic) IBOutlet UILabel *valueLabel;
@end

@implementation NRWCarDetailBaseInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];

}
-(void)setIsDriveCard:(BOOL)isDriveCard{
    _isDriveCard = isDriveCard;
}
-(void)setIsRegisterCard:(BOOL)isRegisterCard{
    _isRegisterCard = isRegisterCard;
}
-(void)setIndex:(NSIndexPath *)index{
    _index = index;
}
-(void)setCarModel:(CarResult *)carModel{
    _carModel = carModel;
    if (_index.row == 0) {
        self.valueLabel.text = carModel.carMileageStr;
    }else if (_index.row == 1){
        self.valueLabel.text = carModel.onTheCardTiem;

    }else if (_index.row == 2){
        if (isEmptyString(carModel.market.city.cityName) == NO) {
            self.valueLabel.text = carModel.market.city.cityName;

        }else{
            self.valueLabel.text = @"--";
        }
            
    }else if (_index.row == 3){
        if (carModel.carTransferNum > 0) {
            self.valueLabel.text = [NSString stringWithFormat:@"%ld次",(long)carModel.carTransferNum];
        }else{
            self.valueLabel.text = @"未过过户";
        }
        
    }else if (_index.row == 4){
        self.valueLabel.text = carModel.carGearbox;
        
    }else if (_index.row == 5){
        self.valueLabel.text = [NSString stringWithFormat:@"%@%@",carModel.carDisplacement,carModel.carInletModel];
        
    }else if (_index.row == 6){
        self.valueLabel.text = carModel.carOutColor;
        
    }else if (_index.row == 7){
        if (isEmptyString(carModel.carInColor) == YES) {
             self.valueLabel.text = @"--";
        }else{
            self.valueLabel.text = carModel.carInColor;
        }
        
    }else if (_index.row == 8){
        self.valueLabel.text = carModel.carPurposeStr;

    }else if (_index.row == 9){
        if (carModel.carForceInsuranceDate > 0) {
            self.valueLabel.text = [NRWCarTurnTime timestampSwitchTime:carModel.carForceInsuranceDate andFormatter:@"yyyy年MM月"];
        }else{
            self.valueLabel.text = @"--";
        }
        
    }else if (_index.row == 10){
        if (carModel.carForceInsuranceDate > 0) {
            self.valueLabel.text = [NRWCarTurnTime timestampSwitchTime:carModel.carBusinessInsuranceDate andFormatter:@"yyyy年MM月"];
        }else{
            self.valueLabel.text = @"--";
        }
        
    }else if (_index.row == 11){
        self.valueLabel.text = carModel.carType.carTypeName ? carModel.carType.carTypeName : @"--";
    }else if (_index.row == 12){
        self.valueLabel.text = @"已验证";
        
    }else if (_index.row == 13){
        if (_isDriveCard == YES) {
            self.valueLabel.text = @"齐全";
        }else{
            self.valueLabel.text = @"不齐全";

        }
        
    }else if (_index.row == 14){
        if (_isRegisterCard == YES) {
            self.valueLabel.text = @"齐全";
        }else{
            self.valueLabel.text = @"不齐全";
        }
        
    }else if (_index.row == 15){
        if (carModel.car4sUpkeepState == 1) {
            self.valueLabel.text = @"齐全";
        }else{
            self.valueLabel.text = @"不齐全";
        }
    }else{
        self.valueLabel.text = @"";
    }

    
}

@end
